<template>
  <div class="link">
    <div class="link-left">
      <div v-for="i in link.left" :key="i.id" class="list">
        <div class="img">
          <img :src="'home/' + i.src" alt="">
        </div>
        <div class="text">
          {{ i.text }}
        </div>
      </div>
    </div>
    <div class="link-center">
      <div v-for="i in $gbData.navs" :key="i.id" class="list">
        <nuxt-link to="/">{{ i.text }}</nuxt-link>
      </div>
    </div>
    <div class="link-right">
      <div v-for="i in link.right" :key="i.id" class="list">
        <img :src="'home/' + i.src" alt="">
        <span> {{ i.text }}</span>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  data() {
    return {
      link: {
        left: [
          {
            text: '首页',
            src: 'shouye.png'
          },
          {
            text: '动态',
            src: 'dongtai.png'
          },
          {
            text: '排行',
            src: 'paihang.png'
          }
        ],
        right: [
          {
            text: '学习',
            src: 'xuexi.png'
          },
          {
            text: '创作',
            src: 'chuangzuo.png'
          },
          {
            text: '活动',
            src: 'huodong.png'
          },
          {
            text: '热门',
            src: 'remen.png'
          }
        ]
      }
    }
  }
})
</script>

<style scoped lang="scss">
.link {
  background-color: #fff;
  border-bottom: 1px solid #eee;
  width: 100%;
  height: 100px;
  display: flex;
  .link-left {
    flex: 0 0 15%;
    display: flex;
    padding: 20px 10px;
    .list {
      height: 100%;
      flex: 1;
      display: flex;
      flex-wrap: wrap;
      cursor: pointer;
      .img {
        width: 100%;
        height: 32px;
        text-align: center;
        img {
          width: 32px;
          height: 32px;
        }
      }
      .text {
        width: 100%;
        height: 40%;
        text-align: center;
        font-size: 14px;
      }
    }
  }
  .link-center {
    flex: 1;
    display: flex;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    align-items: center;
    text-align: center;
    .list {
      flex: 1;
    }
  }
  .link-right {
    flex: 0 0 18%;
    display: flex;
    flex-wrap: wrap;
    padding: 10px 20px;
    .list {
      flex: 0 0 50%;
      display: flex;
      align-items: center;
      cursor: pointer;
      img {
        width: 24px;
        height: 24px;
      }
      span {
        margin-left: 5px;
      }
    }
  }
}
</style>

